Extension Template Catalog
Overview
The extension template catalog is a remote, versioned list of Candescent-maintained starters for web widgets. Use these vetted project layouts when you want a faster path than a blank offline scaffold. The generator downloads the latest catalog, allows users to pick a template, and produces a runnable Nx Module Federation project under widgets/web/ wired for @cdx-extensions/di-sdk-web and the web harness.
Run all commands below from your FI repository root.
Browse the Catalog
Templates are added to the catalog on an ongoing basis. See the full, up-to-date set at generation time (interactive prompts) or with the list command below.
Setup
Install the generator package:
npm install @cdx-extensions/extension-generator-web
Use the same @cdx-extensions registry configuration as the rest of your FI repo (see Getting Started).
See what's available
nx run list-web-widget-templates
This command fetches the same remote catalog the generators use and prints web widget entries grouped by category.
Example: Credit Score (Data Chart)
Browse — category and template picker:
$ nx run generate-web-widget
? Choose a template category: › Data Chart
? Choose a template: › Credit Score — CDX web widget template (credit-score).
? Choose a name for your widget (kebab-case): › acme-credit-score
Outcome — generated widget in the web harness:
Example: Agent (Interactive)
Browse — category and template picker:
$ nx run generate-web-widget
? Choose a template category: › Interactive
? Choose a template: › Agent — CDX web widget template (agent).
? Choose a name for your widget (kebab-case): › acme-agent
Outcome — generated widget in the web harness:
Template ids, categories, and counts change as Candescent publishes new starters. Use nx run list-web-widget-templates or the interactive generator for the current catalog.
Generate Your Extension
Interactive (full flow)
nx run generate-web-extensions
Equivalent:
nx g @cdx-extensions/extension-generator-web:extensions-from-template
Flow:
- Fetches the latest catalog from the remote URL (with cache and local fallbacks).
- Prompts for extension type (from catalog), then category, then template.
- Prompts for your widget name.
- Optionally prompts for an environment
apiUrlwhen the template supports it. - Downloads the selected npm template package and scaffolds the widget under
widgets/web/<name>-widget/.
Widget only (skip type picker)
nx run generate-web-widget
Equivalent:
nx g @cdx-extensions/extension-generator-web:widget
| Workspace command | Underlying generator |
|---|---|
nx run generate-web-extensions | @cdx-extensions/extension-generator-web:extensions-from-template |
nx run generate-web-widget | @cdx-extensions/extension-generator-web:widget |
Non-Interactive / CI Usage
Pass generator options after --:
nx run generate-web-widget -- --template=credit-score --name=acme-credit-score
nx run generate-web-widget -- --template=agent --name=acme-agent
| Option | Required | Description |
|---|---|---|
name | Yes | Widget slug in kebab-case |
template | Yes | Catalog template id (discover ids with nx run list-web-widget-templates) or full npm package name |
stackWidget | No | true for stack-widget layout (default false) |
What You Get
In addition to widget source from the selected template package, the generator writes CDX project scaffold files:
.babelrc,.eslintrc.jsonjest.config.ts,webpack.config.ts,module-federation.config.tsproject.json,tsconfig.json,tsconfig.app.json,tsconfig.spec.json
Widgets scaffold under widgets/web/<name>-widget/.
Scaffold templates ship in the generator package under dist/projectFiles/. When a published template package includes them under dist/, those versions take precedence.
Only modify files inside src/app/ for your widget logic and UI. See Getting Started for the full editability guide.
Advanced
Optional reference for troubleshooting. Most users can skip this section.
Catalog source and cache
On each run the generator syncs catalog/extension-templates.json in this order: remote URL → ~/.cdx/cache/catalog/extension-templates.json → local workspace catalog/extension-templates.json.
Clear ~/.cdx/cache/ after a platform publish if you need a fresh template overlay download.
Today the published web catalog is widget-only. The full-flow generator can prompt for other extension types when the catalog includes them; until then, use nx run generate-web-widget or pick widget in the interactive flow.
Next Steps
- Getting Started — Offline starter vs catalog and editability
- Platform Capabilities (Local) — How local development works with mock data
- Widget Integration — Module Federation, registration, and deployment